<template>
  <view>
    <u-toast ref="uToast"></u-toast>
    <view class="title">业务服务</view>
    <view class="grid">
      <u-grid :border="false" col="4" class="">
        <u-grid-item
          v-for="(baseListItem, index) in baseList"
          :key="index"
          @click="goDetail(index)"
        >
          <u-image
            :src="baseListItem.name"
            width="50px"
            height="50px"
          ></u-image>
          <text class="grid-text">{{ baseListItem.title }}</text>
        </u-grid-item>
      </u-grid>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      itemTabs: [
        {
          name: '今日',
        },
        {
          name: '昨日',
        },
        {
          name: '本月',
        },
      ],
      baseList: [
        {
          name: '/static/image/home/icon_menu_3.png',
          title: '业务拓展',
        },
        {
          name: '/static/image/home/icon_menu_6.png',
          title: '机具管理',
        },
        {
          name: '/static/image/home/icon_menu_1.png',
          title: '激活统计',
        },
        {
          name: '/static/image/home/icon_menu_2.png',
          title: '交易统计',
        },
        {
          name: '/static/image/home/icon_menu_4.png',
          title: '商户管理',
        },
        {
          name: '/static/image/home/icon_menu_5.png',
          title: '代理管理',
        },
        {
          name: '/static/image/home/icon_menu_9.png',
          title: '排行榜',
        },
      ],
    };
  },
  methods: {
    goDetail(index) {
      if (index == 0) {
        this.$u.route('pages/business/business');
      } else if (index == 1) {
        this.$u.route('pages/main/terminal/terminalManager');
        // this.$u.route('/pages/echartsShow/echartsArea')
      } else if (index == 2) {
        this.$u.route('pages/main/terminal/activeStatistic');
        // 激活统计
        // const token = uni.getStorageSync('token');
        // this.$u.route({
        //   url: `pages/benefit/benefitFilterStatistic/jihuotongji?url=https://agent.lsjzg.com/api/h5/index.html#/activeStatistics?loginToken=${token}&type=userRole`,
        // });
      } else if (index == 3) {
        this.$u.route('pages/main/trade/trade-list');
        // 交易统计
        // const token = uni.getStorageSync('token');
        // this.$u.route({
        //   url: `pages/benefit/benefitFilterStatistic/jiaoyitongji?url=https://agent.lsjzg.com/api/h5/index.html#/tradeStatistics?loginToken=${token}&type=userRole`,
        // });
      } else if (index == 4) {
        this.$u.route('pages/main/merchant/merchant-list');
      } else if (index == 5) {
        this.$u.route('pages/main/agent/agent-list');
      } else if (index == 6) {
        this.$u.route('pages/main/rank/rank-list');
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.title {
  font-weight: bold;
  margin-top: 20rpx;
  background: white;
  padding: 20rpx 20rpx 0rpx;
}

.grid {
  background-color: white;
}

.grid-text {
  font-size: 13px;
  padding: 10rpx 0 20rpx 0rpx;
  box-sizing: border-box;
  font-weight: bold;
}
</style>
